function onYouTubePlayerReady(playerId) {
    ytplayer = document.getElementById("player");
}
    
function play() {
  while (!ytplayer) {
    console.log("wait for ytplayer");
  }
  console.log("Play");
  ytplayer.playVideo();
}